#基于
FROM anda/centos-java:1.0
MAINTAINER mike "mike_hmr@126.com"
RUN yum -y install wget && yum -y install tar

#ADD apache-tomcat-8.5.9.tar.gz /usr/local/src
#RUN mkdir /usr/local/tomcat && cp -r /usr/local/src/apache-tomcat-8.5.9/* /usr/local/tomcat/

ENV CATALINA_HOME /usr/local/tomcat/
ENV PATH $PATH:$CATALINA_HOME/bin:$CATALINA_HOME/scripts

# Install Tomcat
ENV TOMCAT_MAJOR 8
ENV TOMCAT_VERSION 8.5.9

RUN wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-${TOMCAT_MAJOR}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz && \
 tar -xvf apache-tomcat-${TOMCAT_VERSION}.tar.gz && \
 rm apache-tomcat*.tar.gz && \
 mv apache-tomcat* ${CATALINA_HOME}

ADD tomcat.sh $CATALINA_HOME/scripts/tomcat.sh
RUN chmod +x $CATALINA_HOME/scripts/*.sh

RUN chmod +x $CATALINA_HOME/bin/*sh

WORKDIR /usr/local/tomcat

EXPOSE 8080
EXPOSE 8009

ENTRYPOINT ["tomcat.sh"]


